import request from '@/utils/request'

const api_name = '/acl/role'

export default {

    getPageList(pageQuery) {
        return request({
            url: `${api_name}/getRolePage`,
            method: 'post',
            data: pageQuery // url查询字符串或表单键值对
        })
    },
    getAllRoles(){

      return request({
        url:`${api_name}/getAllRoles`,
        method:'get'
      })
    },
    getById(id) {
        return request({
          url: `${api_name}/getRoleById?id=${id}`,
          method: 'get'
        })
      },
    
      save(role) {
        return request({
          url: `${api_name}/save`,
          method: 'post',
          data: role
        })
      },
    
      updateById(role) {
        return request({
          url: `${api_name}/update`,
          method: 'put',
          data: role
        })
      },
      // getAssign(roleId){
      //   return request({
      //     url: `${api_name}/toAssign/${roleId}`,
      //     method: 'get'
      //   })
      // },
      removeById(id){
        return request({
          url: `${api_name}/remove?id=${id}`,
          method: 'delete'
        })
      },
      removeRows(idList){
        return request({
          url: `${api_name}/batchRemove`,
          method: 'delete',
          data:idList
        })
      }
      
}
